package com.senthink.gl.business.domain.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.senthink.gl.business.common.entity.BornableEntity;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.*;
import java.util.Date;

/**
 * 民众-居住信息
 *
 * @author zooqi@senthink.com
 * @date 2017/11/28
 */
@Entity
@Table(name = "gl_people_live")
@Getter
@Setter
public class PeopleLive extends BornableEntity<Long> {


    /**
     * 唯一id
     */
    @Column(name = "plid", nullable = false)
    private String plid;

    /**
     * 居住类型  本地  其他
     */
    @Column(name = "site_type")
    private String siteType;

    /**
     * 区域
     */
    @Column(name = "region")
    private String region;

    /**
     * 乡村
     */
    @Column(name = "village")
    private String village;

    /**
     * 详细地址
     */
    @Column(name = "address")
    private String address;

    /**
     * 最后更新时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Column(name = "last_modified_time")
    private Date lastModifiedTime;

    @ManyToOne(targetEntity = People.class)
    @JoinColumn(name = "people", referencedColumnName = "id")
    private People people;
}
